<html>
<head>
    <title>Using sockjs</title>   
    <script src="http://cdn.sockjs.org/sockjs-0.3.min.js"></script>
    <script>
       var sock = new SockJS('localhost:8080');
       sock.onopen = function() {
           console.log('open');
       };
       sock.onmessage = function(e) {
           console.log('message', e.data);
       };
       sock.onclose = function() {
           console.log('close');
       };
    </script>
</head>
<body>
    <script>
        function send(message){
            //TODO: Sending message...
        }
    </script>
    <input id="message" type="text"/><button onclick="send(document.getElementById('message').value)">Ok.</button>
</body>
</html>
